<form class="form-horizontal" id="channelAttrDetailForm">

    <div class="box-body">
        <div class="form-group required">
            <label for="service" class="col-sm-3 control-label">类型名称 :</label>
            <div class="col-sm-8">
                <input type="text" th:value="${channelAttr.service}" class="form-control" name="service" id="service"  require="必填项"  placeholder="" />
            </div>
        </div>
        <div class="form-group">
            <label for="balanceName" class="col-sm-3 control-label">余额名称 :</label>
            <div class="col-sm-8">
                <input type="text" th:value="${channelAttr.balanceName}" class="form-control" name="balanceName" id="balanceName" require="必填项" placeholder="" />
            </div>
        </div>

        <div class="form-group">
            <label  class="col-sm-3 control-label">结算类型 :</label>
            <div class="col-sm-8">
                <select name="settle" class="form-control" require="必填项">
                    <option th:selected="${channelAttr.settle eq 'D0'}" value="D0">D0</option>
                    <option th:selected="${channelAttr.settle eq 'T1'}" value="T1">T1</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label  class="col-sm-3 control-label">产品类型 :</label>
            <div class="col-sm-8">
                <select name="flag" class="form-control" requireZero="必填项">
                    <option th:selected="${channelAttr.flag==0}" value="0">交易产品类型</option>
                    <option th:selected="${channelAttr.flag==1}" value="1">余额代付类型</option>
                    <option th:selected="${channelAttr.flag==2}" value="2">垫资代付类型</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label for="minTip" class="col-sm-3 control-label">产品费率 :</label>
            <div class="col-sm-8">
                <input type="text" th:value="${channelAttr.minTip}" class="form-control" name="minTip" id="minTip" number="格式不正确，只能输入数字" require="必填项" placeholder="" />
            </div>
        </div>

        <div class="form-group">
            <label for="remark" class="col-sm-3 control-label">通道名称 :</label>
            <div class="col-sm-8">
                <input type="text" th:value="${channelAttr.remark}" class="form-control" name="remark" id="remark" require="必填项" placeholder="" />
            </div>
        </div>

    </div>
    <!-- /.box-body -->
    <div class="box-footer">
        <div class="pull-right">
            <button type="button" id="saveDetailChannelAttr" class="btn btn-info">确定</button>
            <button type="button" data-dismiss="modal" class="btn btn-default">取消</button>
        </div>
    </div>
    <!-- /.box-footer -->
</form>

<script>
    $(function () {
        $("#saveDetailChannelAttr").on('click', function () {
            if(doValidForm(channelAttrDetailForm)){
                Core.mask("#saveDetailChannelAttr")
                Core.postAjax(ctxPath + "/channelAttr/edit",$("#channelAttrDetailForm").serialize(),function (data) {
                    Core.unmask("#saveDetailChannelAttr");
                    if(data.code==200){
                        $("#channelAttrDetailModal").modal("hide");
                        Core.refreshJqTable("#table_list",true);
                    }
                    layer.msg(data.msg);
                })
            }
        })
    });
</script>